package com.doom.a3rdlibdemo.ui.main;

import android.util.Log;

import androidx.lifecycle.MutableLiveData;
import androidx.lifecycle.ViewModel;

public class MainViewModel extends ViewModel {
    private static final String TAG = MainViewModel.class.getSimpleName();

    public LiveDataBus<String> phoneInfo;

    public MainViewModel() {
        if(phoneInfo == null) {
            phoneInfo = new LiveDataBus<>();
            phoneInfo.setValue("unknown");
        }
    }

    public LiveDataBus<String> getPhoneInfo() {
        return phoneInfo;
    }

    public void setMessage(String msg) {
        phoneInfo.setValue(msg);
        Log.d(TAG, "setMessage msg:"+msg);
    }

}